//
//  ViewController.m
//  dragDemo
//
//  Created by 吳瀾洲 on 2020/9/24.
//  Copyright © 2020 kingboyrang. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //状态栏高度
    //NSLog(@"status height=%f",[[UIApplication sharedApplication] statusBarFrame].size.height);
    //导航栏高度
    //NSLog(@"height = %f",self.navigationController.navigationBar.frame.size.height);
    
    CGFloat topY = [[UIApplication sharedApplication] statusBarFrame].size.height + self.navigationController.navigationBar.frame.size.height;

    //边距
    UIEdgeInsets edgeInsets = UIEdgeInsetsMake(topY, 0, 30, 0);
    
    //拖动范围
    self.moveView1.moveRect = CGRectMake(edgeInsets.left, edgeInsets.top, self.view.frame.size.width - edgeInsets.right, self.view.frame.size.height - edgeInsets.bottom);
    //是否可以拖动
    self.moveView1.isMove = YES;
    //拖动完成回调
    self.moveView1.moveItemFinishedBlock=^(CGRect frame){
        NSLog(@"frame = %@",NSStringFromCGRect(frame));
    };
    
    
    self.moveView2.moveRect = CGRectMake(edgeInsets.left, edgeInsets.top, self.view.frame.size.width - edgeInsets.right, self.view.frame.size.height - edgeInsets.bottom);
    self.moveView2.isMove = YES;
    // Do any additional setup after loading the view.
}




@end
